package com.amadeus.commons.log.file.finder;

import java.nio.file.Path;
import java.util.List;

import com.amadeus.commons.log.config.ConfigService;
import com.amadeus.commons.log.config.ConfigServices;

public class Controller {

	private ConfigService configService;
	private DirectoryWatcherService watcherService;

	public Controller() {
		configService = ConfigServices.getConfigService();
		watcherService = DirectoryWatcherService.getInstance();
	}

	public void process() {
		List<Path> dirsToWatch = configService.paths("prod", "system-arcausalta1");
		for (Path dir : dirsToWatch) {
			watcherService.watch(dir, false);
		}
		watcherService.processEvents();
	}

}
